Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Base64FileField #149

Merged
merged 8 commits into from
Jan 13, 2021
Merged

Enhance Base64FileField #149

merged 8 commits into from
Jan 13, 2021

Conversation

omerfarukabaci
Copy link
Contributor

@omerfarukabaci omerfarukabaci commented Dec 3, 2020

Completed version of #84. Thanks @ybrs for the contribution.

DEFAULT_CONTENT_TYPE = "application/octet-stream"


class Base64FieldMixin(object):
trust_provided_content_type = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be provided via init method. So that you don't need your own class to change this.

Similar to represent_in_base64 usage.

Copy link
Contributor

@alicertel alicertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you.

@ybrs This is almost done as I promised you last year :)

setup.py Outdated
version='3.0.4',
version='3.0.5',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like changing ContentFile to SimpleUploadedFile is backward incompatible. ContentFile overrides following methods: __init__, __str__, __bool__, open, close and write. These methods also exist in SimpleUploadedFile but they are slightly different in two classes, so it may cause bugs.

Considering this, should we update the major version, or changing minor version is enough? I think changing patch version (like in this commit) is erroneous. What do you think? @alicertel

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with 3.1.0 and document this breaking change in the beginning of the readme. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree. I have made the required changes:

a1cb26a
ce1a970

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank so much. I will take a new release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants